<template>
  <div class="main">
    <el-col :sm="12"
            :lg="6">
      <el-result icon="success"
                 title="提交成功"
                 subTitle="">
        <template slot="extra">
          <div class="code">
            <p>
              查询码
            </p>
            <p>{{ code }}</p>
          </div>
          <el-button type="primary"
                     @click="back"
                     size="medium">返回</el-button>
        </template>
      </el-result>
    </el-col>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // code: 'asdsa'
    }
  },
  computed: {
    code() {
      return this.$route.query.code
    }
  },
  methods: {
    back() {
      if (this.$route.query.type == 'faq1') {
        this.$router.push({ path: '/faq1' })
      } else if (this.$route.query.type == 'faq2') {
        this.$router.push({ path: '/faq2' })
      } else if (this.$route.query.type == 'faq3') {
        this.$router.push({ path: '/faq3' })
      }
    }
  }
}
</script>

<style scoped>
.main {
  background: #fff;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.code {
  font-size: 30px;
}
</style>